//
//  CommonListCell.m
//  HAODE
//
//  Created by panquanReabam.com on 16/5/25.
//  Copyright © 2016年 reabam.com. All rights reserved.
//

#import "CommonListCell.h"

@interface CommonListCell()
@property(nonatomic,strong)UILabel *itemTypes;
@property(nonatomic,strong)UILabel *itemTypesLabel;
@property(nonatomic,strong)UILabel *memberName;
@property(nonatomic,strong)UILabel *memberNameLabel;
@property(nonatomic,strong)UILabel *source;
@property(nonatomic,strong)UILabel *sourceLabel;
@property(nonatomic,strong)UILabel *createDate;
@property(nonatomic,strong)UILabel *createDateLabel;
@property(nonatomic,strong)UILabel *NoLabel;
@property(nonatomic,strong)UILabel *totalMoney;
@property(nonatomic,strong)UILabel *totalMoneyLabel;
@property(nonatomic,strong)UILabel *depositLabel;
@property(nonatomic,strong)UILabel *lineLabel;
@property(nonatomic,strong)UILabel *state1;
@property(nonatomic,strong)UILabel *state2;
@property(nonatomic,strong)UILabel *state3;
@end
@implementation CommonListCell

- (void)awakeFromNib {

}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createView];
        [self setViewAutoLayout];
    }
    return self;
}
-(void)createView
{
    self.backgroundColor=[UIColor whiteColor];
    self.NoLabel=[[UILabel alloc] init];
    self.NoLabel.font= [UIFont systemFontOfSize:17];
    self.NoLabel.textColor=[UIColor colorWithRed:0/255.0f green:0/255.0f blue:0/255.0f alpha:1.0];
    [self addSubview:self.NoLabel];
    self.state1=[[UILabel alloc] init];
    self.state1.font= [UIFont systemFontOfSize:13];
    self.state1.textAlignment=NSTextAlignmentCenter;
    [self addSubview:self.state1];
    self.state2=[[UILabel alloc] init];
    self.state2.font= [UIFont systemFontOfSize:13];
    [self addSubview:self.state2];
    self.state3=[[UILabel alloc] init];
    self.state3.font= [UIFont systemFontOfSize:13];
    [self addSubview:self.state3];
    self.memberName=[[UILabel alloc] init];
    self.memberName.font= [UIFont systemFontOfSize:14];
    self.memberName.text=@"会员";
    self.memberName.textColor=zhonghuiColor;
    [self addSubview:self.memberName];
    self.memberNameLabel=[[UILabel alloc] init];
    self.memberNameLabel.font= [UIFont systemFontOfSize:14];
    self.memberNameLabel.textColor=shenhuiColor;
    [self addSubview:self.memberNameLabel];
    self.source=[[UILabel alloc] init];
    self.source.font= [UIFont systemFontOfSize:14];
    self.source.text=@"来源";
    self.source.textColor=zhonghuiColor;
    [self addSubview:self.source];
    self.sourceLabel=[[UILabel alloc] init];
    self.sourceLabel.font= [UIFont systemFontOfSize:14];
    self.sourceLabel.textColor=shenhuiColor;
    [self addSubview:self.sourceLabel];
    self.createDate=[[UILabel alloc] init];
    self.createDate.font= [UIFont systemFontOfSize:14];
    self.createDate.text=@"日期";
    self.createDate.textColor=zhonghuiColor;
    [self addSubview:self.createDate];
    self.createDateLabel=[[UILabel alloc] init];
    self.createDateLabel.font= [UIFont systemFontOfSize:14];
    self.createDateLabel.textColor=shenhuiColor;
    [self addSubview:self.createDateLabel];
    self.itemTypes=[[UILabel alloc] init];
    self.itemTypes.font= [UIFont systemFontOfSize:14];
    self.itemTypes.textColor=zhonghuiColor;
    [self addSubview:self.itemTypes];
    self.itemTypesLabel=[[UILabel alloc] init];
    self.itemTypesLabel.font= [UIFont systemFontOfSize:14];
    self.itemTypesLabel.textColor=shenhuiColor;
    [self addSubview:self.itemTypesLabel];
    self.totalMoney=[[UILabel alloc] init];
    self.totalMoney.font= [UIFont systemFontOfSize:14];
    self.totalMoney.text=@"金额 ¥";
    self.totalMoney.textColor=zhonghuiColor;
    [self addSubview:self.totalMoney];
    self.totalMoneyLabel=[[UILabel alloc] init];
    self.totalMoneyLabel.font= [UIFont systemFontOfSize:14];
    self.totalMoneyLabel.textColor=qianheiColor;
    [self addSubview:self.totalMoneyLabel];
   
    self.depositLabel=[[UILabel alloc] init];
    self.depositLabel.font= [UIFont systemFontOfSize:14];
    self.depositLabel.textColor=shenhuiColor;
    [self addSubview:self.depositLabel];

    self.lineLabel=[[UILabel alloc] initWithFrame:CGRectMake(10, 108.5, ScreenWidth-20, 0.5)];
    [self.lineLabel setBackgroundColor:[UIColor colorWithRed:238.0f/255.0f green:238.0f/255.0f blue:238.0f/255.0f alpha:1.0f]];
    self.lineLabel.textColor=[UIColor clearColor];
    [self addSubview:self.lineLabel];
}
-(void)setModel:(OrderListModel *)model{
    
    if ([model.docType isEqualToString:@"Booking"]) {
        self.state1.textColor=[UIColor whiteColor];
        self.state1.backgroundColor=orangeCol;
        self.state1.font=[UIFont systemFontOfSize:11];
        self.state1.text=[NSString stringWithFormat:@"%@", @"预售 "];
    }else if([model.docType isEqualToString:@"Retail"]){
        self.state1.font=[UIFont systemFontOfSize:11];
        self.state1.textColor=[UIColor whiteColor];
        self.state1.backgroundColor=luseColor;
        self.state1.text=[NSString stringWithFormat:@"%@", @"零售 "];
    }else if([model.docType isEqualToString:@"Wx"]){
        self.state1.font=[UIFont systemFontOfSize:11];
        self.state1.textColor=[UIColor whiteColor];
        self.state1.backgroundColor=orangeCol;
        self.state1.text=[NSString stringWithFormat:@"%@ ", model.docTypeName];
    }else if([model.docType isEqualToString:@"Integral"]){
        self.state1.font=[UIFont systemFontOfSize:11];
        self.state1.textColor=[UIColor whiteColor];
        self.state1.backgroundColor=orangeCol;
        self.state1.text=[NSString stringWithFormat:@"%@ ", model.docTypeName];
    }


    
    if ([[NSString stringWithFormat:@"%@",  model.payStatusName]isEqualToString:@"已收银"]) {
         self.state2.textColor=luseColor;
    }else{
     self.state2.textColor=shenhongseColor;
    }
    if ([[NSString stringWithFormat:@"%@",  model.orderStatusName]isEqualToString:@"已完成"]) {
        self.state3.textColor=luseColor;
    }else if([[NSString stringWithFormat:@"%@",  model.orderStatusName]isEqualToString:@"已取消"]){
        self.state3.textColor=shenhuiColor;

    }else if([[NSString stringWithFormat:@"%@",  model.orderStatusName]isEqualToString:@"已配送"]){
        self.state3.textColor=luseColor;
        
    }
    else{
    
        self.state3.textColor=shenhongseColor;

    }
    
        self.state2.text=[NSString stringWithFormat:@"%@",  model.payStatusName];
        self.state3.text=[NSString stringWithFormat:@"%@",  model.orderStatusName];
    
    
    
    
    self.NoLabel.text=[NSString stringWithFormat:@"%@",  model.orderNo];
    self.lineLabel.text=[NSString stringWithFormat:@"%@",model.orderNo];
    if ([[NSString stringWithFormat:@"%@",model.memberName]isEqualToString:@"<null>"]) {
         self.memberNameLabel.text=[NSString stringWithFormat:@"%@",@"零售会员"];
    }else{
        if (model.memberName ==NULL||[[NSString stringWithFormat:@"%@",model.memberName]isEqualToString:@""]) {
             self.memberNameLabel.text=[NSString stringWithFormat:@"%@",@"零售会员"];
        }else{
            self.memberNameLabel.text=[NSString stringWithFormat:@"%@",model.memberName];
        }
    }
    self.sourceLabel.text=[NSString stringWithFormat:@"%@",model.source];
    NSString*GoldPrice=[NSString stringWithFormat:@"%@",model.totalMoney];
    NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    [numberFormatter setPositiveFormat:@"###,##0.00;"];
    NSString *formattedNumberString = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:GoldPrice.floatValue]];
    self.totalMoneyLabel.text=[NSString stringWithFormat:@"%@",formattedNumberString];
   
   
    self.createDateLabel.text=[NSString stringWithFormat:@"%@",model.orderDate];
    self.itemTypes.text=@"购买";
    self.itemTypesLabel.text=[NSString stringWithFormat:@"%@ 共%@件",model.itemTypes,model.totalQuantity];
    if ([[NSString stringWithFormat:@"%@",model.orderStatus ] isEqualToString:@"P"]) {
        
        NSString*GoldPrice1=[NSString stringWithFormat:@"%@",model.earnestMoney];
        NSNumberFormatter *numberFormatter1 = [[NSNumberFormatter alloc] init];
        [numberFormatter1 setPositiveFormat:@"###,##0.00;"];
        NSString *formattedNumberString1 = [numberFormatter1 stringFromNumber:[NSNumber numberWithDouble:GoldPrice1.floatValue]];
        self.depositLabel.text=[NSString stringWithFormat:@"已收定金 ￥%@",formattedNumberString1];
        self.depositLabel.textColor=[UIColor blackColor];

        NSMutableAttributedString *AttributedStr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"已收定金 ￥%@",formattedNumberString1]];
        
        [AttributedStr addAttribute:NSFontAttributeName
         
                              value:[UIFont systemFontOfSize:contenfot]
         
                              range:NSMakeRange(0, 6)];
        
        [AttributedStr addAttribute:NSForegroundColorAttributeName
         
                              value:shenhuiColor
         
                              range:NSMakeRange(0, 6)];
        
        
        self.depositLabel.attributedText = AttributedStr;
        
    }

}



-(void)setDeliveryModel:(DeliveryListModel *)DeliveryModel{
    
    if ([DeliveryModel.deliveryStatus isEqualToString:@"Y"]) {
        self.state1.textColor=[UIColor whiteColor];
        self.state1.backgroundColor=luseColor;
        self.state1.font=[UIFont systemFontOfSize:11];
        self.state1.text=[NSString stringWithFormat:@"%@", @"配送 "];
    }else{
        self.state1.font=[UIFont systemFontOfSize:11];
        self.state1.textColor=[UIColor whiteColor];
        self.state1.backgroundColor=orangeCol;
        self.state1.text=[NSString stringWithFormat:@"%@", @"自提 "];
    }
    if ([DeliveryModel.deliveryStatus isEqualToString:@"Y"]) {
        self.state2.textColor=shenhongseColor;
        self.state2.text=[NSString stringWithFormat:@"%@",  DeliveryModel.deliveryStatusName];
    }
    if ([DeliveryModel.deliveryStatus isEqualToString:@"F"]) {
        self.state2.textColor=luseColor;
        self.state2.text=[NSString stringWithFormat:@"%@",  DeliveryModel.deliveryStatusName];
    }

    self.NoLabel.text=[NSString stringWithFormat:@"%@", DeliveryModel.deliveryNo];
   self.lineLabel.text=[NSString stringWithFormat:@"%@",DeliveryModel.deliveryNo];
    self.memberNameLabel.text=[NSString stringWithFormat:@"%@",DeliveryModel.memberName];
    self.sourceLabel.text=[NSString stringWithFormat:@"%@",DeliveryModel.source];
    NSString*GoldPrice=[NSString stringWithFormat:@"%@",DeliveryModel.totalMoney];
    NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    [numberFormatter setPositiveFormat:@"###,##0.00;"];
    NSString *formattedNumberString = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:GoldPrice.floatValue]];
    self.totalMoneyLabel.text=[NSString stringWithFormat:@"%@",formattedNumberString];
//    NSRange range={0,10};
//    NSString* string =[DeliveryModel.deliveryDate substringWithRange:range];
    self.createDateLabel.text=[NSString stringWithFormat:@"%@",DeliveryModel.deliveryDate];
    self.itemTypes.text=@"配送";
    self.itemTypesLabel.text=[NSString stringWithFormat:@"%@ 共%@件",DeliveryModel.itemTypes,DeliveryModel.totalQuantity];
    
}
-(void)setWhsOutListModel:(WhsOutListModel *)WhsOutListModel{

    self.state1.textColor=luseColor;
    self.state1.text=[NSString stringWithFormat:@"%@",  WhsOutListModel.whsOutTypeName];
    self.NoLabel.text=[NSString stringWithFormat:@"%@", WhsOutListModel.whsOutNo];
   self.lineLabel.text=[NSString stringWithFormat:@"%@",WhsOutListModel.whsOutNo];
    self.memberName.text=[NSString stringWithFormat:@"%@",@"员工"];
    self.memberNameLabel.text=[NSString stringWithFormat:@"%@",WhsOutListModel.createName];
    self.source.text=[NSString stringWithFormat:@"%@",@"仓库"];
    self.sourceLabel.text=[NSString stringWithFormat:@"%@",WhsOutListModel.whsName];
    NSString*GoldPrice=[NSString stringWithFormat:@"%@",WhsOutListModel.totalMoney];
    NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    [numberFormatter setPositiveFormat:@"###,##0.00;"];
    NSString *formattedNumberString = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:GoldPrice.floatValue]];
    self.totalMoneyLabel.text=[NSString stringWithFormat:@"%@",formattedNumberString];
   
   
    self.createDateLabel.text=[NSString stringWithFormat:@"%@",WhsOutListModel.whsOutDate];
    self.itemTypes.text=@"出库";
    self.itemTypesLabel.text=[NSString stringWithFormat:@"%@ 共%@件",WhsOutListModel.itemTypes,WhsOutListModel.totalQuantity];

}

-(void)setWhsInListModel:(WhsInListModel *)WhsInListModel{

    self.state1.textColor=luseColor;
    self.state1.text=[NSString stringWithFormat:@"%@",  WhsInListModel.whsInTypeName];
    self.NoLabel.text=[NSString stringWithFormat:@"%@", WhsInListModel.whsInNo];
   self.lineLabel.text=[NSString stringWithFormat:@"%@",WhsInListModel.whsInNo];
    self.memberName.text=[NSString stringWithFormat:@"%@",@"员工"];
    self.memberNameLabel.text=[NSString stringWithFormat:@"%@",WhsInListModel.createName];
    self.source.text=[NSString stringWithFormat:@"%@",@"仓库"];
    self.sourceLabel.text=[NSString stringWithFormat:@"%@",WhsInListModel.whsName];
    NSString*GoldPrice=[NSString stringWithFormat:@"%@",WhsInListModel.totalMoney];
    NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    [numberFormatter setPositiveFormat:@"###,##0.00;"];
    NSString *formattedNumberString = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:GoldPrice.floatValue]];
    self.totalMoneyLabel.text=[NSString stringWithFormat:@"%@",formattedNumberString];

    self.createDateLabel.text=[NSString stringWithFormat:@"%@",WhsInListModel.whsInDate];
    self.itemTypes.text=@"入库";
    self.itemTypesLabel.text=[NSString stringWithFormat:@"%@ 共%@件",WhsInListModel.itemTypes,WhsInListModel.totalQuantity];
}
-(void)setCheckVouchListModel:(CheckVouchListModel *)CheckVouchListModel{

  
    if ([CheckVouchListModel.ckvStatus isEqualToString:@"YT"]) {
        self.state1.textColor=luseColor;
     self.state1.text=[NSString stringWithFormat:@"%@",  CheckVouchListModel.ckvStatusName];
    }else
    if ([CheckVouchListModel.ckvStatus isEqualToString:@"NP"]) {
        self.state1.textColor=shenhongseColor;
        self.state1.text=[NSString stringWithFormat:@"%@",  CheckVouchListModel.ckvStatusName];
    }else
        if ([CheckVouchListModel.ckvStatus isEqualToString:@"YP"]) {
            self.state1.textColor=shenhongseColor;
            self.state1.text=[NSString stringWithFormat:@"%@",  CheckVouchListModel.ckvStatusName];
        }else
            if ([CheckVouchListModel.ckvStatus isEqualToString:@"YF"]) {
                self.state1.textColor=luseColor;
                self.state1.text=[NSString stringWithFormat:@"%@",  CheckVouchListModel.ckvStatusName];
            }else{
            
                self.state1.textColor=zhonghuiColor;
                self.state1.text=[NSString stringWithFormat:@"%@",  CheckVouchListModel.ckvStatusName];

            }

    self.NoLabel.text=[NSString stringWithFormat:@"%@", CheckVouchListModel.ckvNo];
    self.lineLabel.text=[NSString stringWithFormat:@"%@",CheckVouchListModel.ckvNo];
    self.memberName.text=[NSString stringWithFormat:@"%@",@"员工"];
    self.memberNameLabel.text=[NSString stringWithFormat:@"%@",CheckVouchListModel.userName];
   

    self.createDate.text=@"";
    self.source.text=[NSString stringWithFormat:@"%@",@"日期"];
    self.sourceLabel.text=[NSString stringWithFormat:@"%@",CheckVouchListModel.createDate];
    self.itemTypes.text=@"盘点";
    self.itemTypesLabel.text=[NSString stringWithFormat:@"%@ %@件",CheckVouchListModel.itemTypeName,CheckVouchListModel.alreadyCheck];
    self.totalMoney.text=[NSString stringWithFormat:@"%@",@"已盘点"];
    self.totalMoneyLabel.text=[NSString stringWithFormat:@"%@件",CheckVouchListModel.totalQuantity];
}
-(void)setNeedOrderListModel:(NeedOrderListModel *)NeedOrderListModel{

    
    if ([NeedOrderListModel.needStatus isEqualToString:@"Y"]) {
        self.state1.textColor=luseColor;
        self.state1.text=[NSString stringWithFormat:@"%@",  NeedOrderListModel.needStatusName];
    }else
    if ([NeedOrderListModel.needStatus isEqualToString:@"N"]) {
        self.state1.textColor=shenhongseColor;
        self.state1.text=[NSString stringWithFormat:@"%@",  NeedOrderListModel.needStatusName];

    }else if ([[NSString stringWithFormat:@"%@",NeedOrderListModel.needStatus] isEqualToString:@"C"]){
        self.state1.textColor=shenhuiColor;
        self.state1.text=[NSString stringWithFormat:@"%@",  NeedOrderListModel.needStatusName];

    }
    
    self.NoLabel.text=[NSString stringWithFormat:@"%@", NeedOrderListModel.needNo];
   self.lineLabel.text=[NSString stringWithFormat:@"%@",NeedOrderListModel.needNo];
    self.memberName.text=[NSString stringWithFormat:@"%@",@"员工"];
    self.memberNameLabel.text=[NSString stringWithFormat:@"%@",NeedOrderListModel.createName];
//    NSRange range={0,10};
//    NSString* string =[NeedOrderListModel.createDate substringWithRange:range];

    self.source.text=[NSString stringWithFormat:@"%@",@"日期"];
    self.sourceLabel.text=[NSString stringWithFormat:@"%@",NeedOrderListModel.createDate];
    self.createDateLabel.text=[NSString stringWithFormat:@"%@",@""];
    self.createDate.text=[NSString stringWithFormat:@"%@",@""];

    
    NSString*GoldPrice=[NSString stringWithFormat:@"%@",NeedOrderListModel.totalMoney];
    NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    [numberFormatter setPositiveFormat:@"###,##0.00;"];
    NSString *formattedNumberString = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:GoldPrice.floatValue]];
    self.totalMoneyLabel.text=[NSString stringWithFormat:@"%@",formattedNumberString];
    self.itemTypes.text=@"商品";
    self.itemTypesLabel.text=[NSString stringWithFormat:@"%@ 共%@件",NeedOrderListModel.itemTypes,NeedOrderListModel.totalQuantity];


}
-(void)setGoodsInOrderListModel:(GoodsInOrderListModel *)GoodsInOrderListModel{



    
    
    if ([GoodsInOrderListModel.status isEqualToString:@"NA"]) {
        self.state1.textColor=shenhongseColor;
    }else if ([GoodsInOrderListModel.status isEqualToString:@"YR"]) {
            self.state1.textColor=shenhongseColor;
       
    }else if ([GoodsInOrderListModel.status isEqualToString:@"YC"]) {
        self.state1.textColor=shenhuiColor;
        }else if ([GoodsInOrderListModel.status isEqualToString:@"YI"]) {
        self.state1.textColor=luseColor;
        
        }else if ([GoodsInOrderListModel.status isEqualToString:@"YB"]) {
            self.state1.textColor=[UIColor colorWithRed:253/255.0 green:152/255.0 blue:39/255.0 alpha:1];
        }
    
    else{
            
            self.state1.textColor=luseColor;
        }
    
    
    self.state1.text=[NSString stringWithFormat:@"%@",  GoodsInOrderListModel.statusName];
    
    self.NoLabel.text=[NSString stringWithFormat:@"%@", GoodsInOrderListModel.orderNo];
    self.lineLabel.text=[NSString stringWithFormat:@"%@",GoodsInOrderListModel.orderNo];
    
    self.memberName.text=[NSString stringWithFormat:@"%@",@"员工"];
    
    self.memberNameLabel.text=[NSString stringWithFormat:@"%@",GoodsInOrderListModel.createName];
//    NSRange range={0,16};
    NSString* string =GoodsInOrderListModel.createDate ;
    
    
    self.source.text=[NSString stringWithFormat:@"%@",@"供应商"];
    self.sourceLabel.text=[NSString stringWithFormat:@"%@",GoodsInOrderListModel.supplierName];
    
    self.createDate.text=@"时间";
    self.createDateLabel.text=[NSString stringWithFormat:@"%@",string];
    
    self.itemTypes.text=@"商品";
    self.itemTypesLabel.text=[NSString stringWithFormat:@"%@%@件",GoodsInOrderListModel.itemTypes,GoodsInOrderListModel.totalQuantity];
    
    
    self.totalMoney.text=@"金额￥";
    
    self.totalMoneyLabel.text=[NSString stringWithFormat:@"%.2f",GoodsInOrderListModel.totalMoney.doubleValue];


}



-(void)setAllotOrderListModel:(AllotOrderListModel *)AllotOrderListModel{

    if ([AllotOrderListModel.allotType isEqualToString:@"转出"]) {
        self.state1.textColor=[UIColor whiteColor];
        self.state1.backgroundColor=[UIColor colorWithRed:252/255.0 green:102/255.0 blue:33/255.0 alpha:1];
        self.state1.text=[NSString stringWithFormat:@"%@ " ,AllotOrderListModel.allotType];
        self.state1.font=[UIFont systemFontOfSize:11];
        self.source.text=[NSString stringWithFormat:@"%@",@"到仓库"];
        self.sourceLabel.text=[NSString stringWithFormat:@"%@",AllotOrderListModel.inWhsName];
    
    }else{
        self.state1.textColor=[UIColor whiteColor];
        self.state1.backgroundColor=luseColor;
        self.state1.font=[UIFont systemFontOfSize:11];
        self.state1.text=[NSString stringWithFormat:@"%@ " ,AllotOrderListModel.allotType];
        self.source.text=[NSString stringWithFormat:@"%@",@"从仓库"];
         self.sourceLabel.text=[NSString stringWithFormat:@"%@",AllotOrderListModel.outWhsName];
    
    }

    
    
    if ([AllotOrderListModel.status isEqualToString:@"NA"]) {
        self.state2.textColor=shenhongseColor;
    }else
        if ([AllotOrderListModel.status isEqualToString:@"YR"]) {
            self.state2.textColor=shenhongseColor;
        }else{
            
            self.state2.textColor=luseColor;
        }
    
    
    self.state2.text=[NSString stringWithFormat:@"%@",  AllotOrderListModel.statusName];
    
    self.NoLabel.text=[NSString stringWithFormat:@"%@", AllotOrderListModel.orderNo];
    self.lineLabel.text=[NSString stringWithFormat:@"%@",AllotOrderListModel.orderNo];
   
    self.memberName.text=[NSString stringWithFormat:@"%@",@"员工"];
    
    self.memberNameLabel.text=[NSString stringWithFormat:@"%@",AllotOrderListModel.createName];
//        NSRange range={0,16};
        NSString* string =AllotOrderListModel.createDate ;
    
  
   
    
    self.createDate.text=@"时间";
    self.createDateLabel.text=[NSString stringWithFormat:@"%@",string];
    
    self.itemTypes.text=@"商品";
    self.itemTypesLabel.text=[NSString stringWithFormat:@"%@",AllotOrderListModel.itemTypes];
    
    
    self.totalMoney.text=@"金额￥";
    
    self.totalMoneyLabel.text=[NSString stringWithFormat:@"%@",AllotOrderListModel.totalMoney];
    


}
-(void)setBookingOrderModel:(BookingOrderModel *)BookingOrderModel{
    
   
    
    
    if ([BookingOrderModel.status isEqualToString:@"NA"]) {
        self.state1.textColor=shenhongseColor;
    }else
        if ([BookingOrderModel.status isEqualToString:@"YR"]) {
            self.state1.textColor=shenhongseColor;
        }else{
        
         self.state1.textColor=luseColor;
        }
    

    self.state1.text=[NSString stringWithFormat:@"%@",  BookingOrderModel.statusName];
    self.NoLabel.text=[NSString stringWithFormat:@"%@", BookingOrderModel.orderNo];
    self.lineLabel.text=[NSString stringWithFormat:@"%@",BookingOrderModel.orderNo];
    self.memberName.text=[NSString stringWithFormat:@"%@",@"会员"];
    self.memberNameLabel.text=[NSString stringWithFormat:@"%@",BookingOrderModel.memberName];
//    NSRange range={0,10};
//    NSString* string =[BookingOrderModel.bookingDate substringWithRange:range];

    self.source.text=[NSString stringWithFormat:@"%@",@"预约时间"];
    self.sourceLabel.text=[NSString stringWithFormat:@"%@  %@",BookingOrderModel.bookingDate ,BookingOrderModel.bookingTime];
    
    self.createDate.text=@"";
    self.createDateLabel.text=[NSString stringWithFormat:@"%@",@""];
    
    self.itemTypes.text=@"预约项目";
    self.itemTypesLabel.text=[NSString stringWithFormat:@"%@",BookingOrderModel.bookingItemName];
    
    
    self.totalMoney.text=@"检测否";
    
    if ([[NSString stringWithFormat:@"%@",BookingOrderModel.isCheck]isEqualToString:@"0"]) {
        self.totalMoneyLabel.text=[NSString stringWithFormat:@"%@",@"否"];
    }else{
    self.totalMoneyLabel.text=[NSString stringWithFormat:@"%@",@"是"];
    }

}

-(void)setRefundListModel:(RefundListModel *)RefundListModel{
    self.state1.backgroundColor=luseColor;
    self.state1.textColor=[UIColor whiteColor];
    self.state1.text=[NSString stringWithFormat:@"%@ ", RefundListModel.rgTypeName];
    self.state2.textColor=luseColor;
    self.state2.text=[NSString stringWithFormat:@"%@",  RefundListModel.refundStatusName];
    self.NoLabel.text=[NSString stringWithFormat:@"%@", RefundListModel.refundNo];
    self.lineLabel.text=[NSString stringWithFormat:@"%@",RefundListModel.refundNo];
    
    
    if ([[NSString stringWithFormat:@"%@",RefundListModel.memberName]isEqualToString:@"<null>"]) {
        self.memberNameLabel.text=[NSString stringWithFormat:@"%@",@"零售会员"];
    }else{
        if (RefundListModel.memberName ==NULL||[[NSString stringWithFormat:@"%@",RefundListModel.memberName]isEqualToString:@""]) {
            self.memberNameLabel.text=[NSString stringWithFormat:@"%@",@"零售会员"];
        }else{
            self.memberNameLabel.text=[NSString stringWithFormat:@"%@",RefundListModel.memberName];
        }
    }

    self.sourceLabel.text=[NSString stringWithFormat:@"%@",RefundListModel.source];
    NSString*GoldPrice=[NSString stringWithFormat:@"%@",RefundListModel.totalMoney];
    NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    [numberFormatter setPositiveFormat:@"###,##0.00;"];
    NSString *formattedNumberString = [numberFormatter stringFromNumber:[NSNumber numberWithDouble:GoldPrice.floatValue]];
    self.totalMoneyLabel.text=[NSString stringWithFormat:@"%@",formattedNumberString];
//    NSRange range={0,10};
//    NSString* string =[RefundListModel.createDate substringWithRange:range];
    self.createDateLabel.text=[NSString stringWithFormat:@"%@",RefundListModel.createDate];
    self.itemTypes.text=@"退货";
    self.itemTypesLabel.text=[NSString stringWithFormat:@"%@ 共%@件",RefundListModel.itemTypes,RefundListModel.totalQuantity];
    
}


-(void)setViewAutoLayout
{
    [self.NoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(15) ;
        make.height.equalTo(@17);
        make.top.equalTo(self.mas_top).with.offset(24);
    }];
    
    [self.state1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.NoLabel.mas_right).with.offset(7.5);
        make.height.equalTo(@13);
        
         make.centerY.equalTo(self.NoLabel.mas_centerY) ;
    }];
    [self.state2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.state1.mas_right).with.offset(5);
        make.height.equalTo(@13);
        
        make.centerY.equalTo(self.NoLabel.mas_centerY) ;
    }];
    [self.state3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.state2.mas_right).with.offset(5);
        make.height.equalTo(@13);
        
        make.centerY.equalTo(self.NoLabel.mas_centerY) ;
    }];
    [self.memberName mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.mas_left).with.offset(15) ;
        make.height.equalTo(@14);
        make.top.equalTo(self.NoLabel.mas_bottom).with.offset(14);
    }];
    
    [self.memberNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.memberName.mas_right).with.offset(3);
        make.height.equalTo(@14);
        
        make.centerY.equalTo(self.memberName.mas_centerY) ;
        
    }];
    
    
    [self.source mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.memberNameLabel.mas_right).with.offset(15) ;
        make.height.equalTo(@14);
       make.centerY.equalTo(self.memberName.mas_centerY) ;
    }];
    
    [self.sourceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.source.mas_right).with.offset(3);
        make.height.equalTo(@14);
        
       make.centerY.equalTo(self.memberName.mas_centerY) ;
        
    }];
    [self.createDate mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.sourceLabel.mas_right).with.offset(15);
        
        make.height.equalTo(@14);
        
      make.centerY.equalTo(self.memberName.mas_centerY) ;
    }];
    
    [self.createDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.createDate.mas_right).with.offset(3);
        make.height.equalTo(@14);
        
        make.centerY.equalTo(self.memberName.mas_centerY) ;
        
    }];
    
    
    [self.itemTypes mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.mas_left).with.offset(15) ;
        make.height.equalTo(@14);
        make.top.equalTo(self.memberName.mas_bottom).with.offset(3);
    }];
    
    [self.itemTypesLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.itemTypes.mas_right).with.offset(3);
        make.height.equalTo(@14);
        make.centerY.equalTo(self.itemTypes.mas_centerY) ;
        
    }];
    [self.totalMoney mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.itemTypesLabel.mas_right).with.offset(15) ;
        make.height.equalTo(@14);
        make.centerY.equalTo(self.itemTypes.mas_centerY) ;

    }];
    
    [self.totalMoneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.totalMoney.mas_right).with.offset(3);
        make.height.equalTo(@14);
        make.centerY.equalTo(self.itemTypes.mas_centerY) ;
        
    }];
    [self.depositLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.totalMoneyLabel.mas_right).with.offset(15);
        make.height.equalTo(@14);
        make.centerY.equalTo(self.itemTypes.mas_centerY) ;
        
    }];
        [self.lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.mas_left).with.offset(10);
            make.right.equalTo(self.mas_right).with.offset(-10) ;
            make.height.equalTo(@0.5);
            make.top.equalTo(self.mas_top).with.offset(108.5);
        }];

    
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
